<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;"><meta charset="utf-8">
<title>个人信息填表</title>
    <link rel="stylesheet" type="text/css" href="/before/h-ui/css/H-ui.min.css" />
    <script type="text/javascript" src="/before/h-ui/js/H-ui.js"></script>
    <script type="text/javascript" src="/before/js/jquery-3.1.1.min.js"></script>
    <style type="text/css">
        span{
            color: red;
            font-size: 13px;
        }
    </style>
</head>
<script>
    var getUser = function() {
        $.ajax({
            url : "/address/getUser.do",
            type : "POST",
            dataType : "json",
            success : function(msg) {
                console.log(msg)
                if(msg.hashMap.user==null){
                    top.location.href="HJHStageLogin.ftl";
                }
            }
        });
    }
    getUser();

</script>
<body>
<table style="text-align:center;"  width="400px" height="500" cellpadding="0" cellspacing="0">
<caption><font size="+1" color="#FF9966" >个人资料</font></caption>
<tbody>
<tr>
<td>用户名</td><td>
   ${NowCustom.name}

</td>
</tr>
<tr>
    <td>姓名</td><td>
    <input type="hidden"  id="id" name="id" value="${NowCustom.id}">
    <input type="text" name="realName" id="realName" style="border: none;" onkeyup="panduan(this)" value="${NowCustom.realName}"><span></span>

</td>
</tr>
<tr>
    <td>性别</td><td>
${NowCustom.sex}<span style="color: grey;font-size: 12px;" >(不可修改)</span>
</td>
</tr>
<tr>
    <td>电话</td><td>
    <input type="text" name="phone" id="phone" style="border: none;" onkeyup="panduan(this)" value="${NowCustom.phone}"><span></span>
</td>
</tr>
<tr>
    <td>邮箱</td><td>
    <input type="text" name="email" id="email" style="border: none;" onkeyup="panduan(this)" value="${NowCustom.email}"><span></span>


</td>
</tr>
    <tr><td>
         <input type="button" id="tijiao" onclick="sub()"  class="btn btn-primary radius disabled" value="保存">
    </td>
    </tr>
</tbody>
</table>

</body>
</html>
<script>
    function panduan(obj){
     var temp=obj;
      if($(temp).val()==null || $(temp).val()==""){
         $(temp).next().text("不能为空")
          $("#tijiao").attr("class","btn btn-primary radius disabled");
      }


        if($(temp).val()!=null && $(temp).val()!=""){
            $("#tijiao").attr("class","btn btn-primary radius");
            $(temp).next().text("");
        }
    }
    function sub(){
        $.ajax({
            url:"/order/updatexinxi.do",
            type:'post',
            dataType:'json',
            data:{
                realName:$("#realName").val(),
                phone:$("#phone").val(),
                email:$("#email").val()

            }

        })
        $("#tijiao").attr("class","btn btn-primary radius disabled");
    }


</script>